import xadmin
from apps.organization.models import CityDict, CourseOrg, Teacher


class CityDictAdmin(object):
    list_display = ['name', 'desc', 'add_time']

    list_filter = ['name', 'desc']

    search_fields = ['name', 'desc', 'add_time']


class CourseOrgAdmin(object):
    list_display = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city', 'add_time']

    list_filter = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city']

    search_fields = ['name', 'desc', 'click_nums', 'fav_nums', 'image', 'address', 'city', 'add_time']


class TeacherAdmin(object):
    list_display = ['org', 'name', 'work_years', ' work_company', 'work_position', 'points', 'click_nums', 'fav_nums',
                    'add_time']

    list_filter = ['org', 'name', 'work_years', ' work_company', 'work_position', 'points', 'click_nums', 'fav_nums']

    search_fields = ['org', 'name', 'work_years', ' work_company', 'work_position', 'points', 'click_nums', 'fav_nums',
                     'add_time']


xadmin.site.register(CityDict, CityDictAdmin)
xadmin.site.register(CourseOrg, CourseOrgAdmin)
xadmin.site.register(Teacher, TeacherAdmin)
